<?php /* Smarty version 2.6.26, created on 2015-07-01 11:30:25
         compiled from 1.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', '1.html', 12, false),array('modifier', 'capitalize', '1.html', 25, false),array('modifier', 'cat', '1.html', 27, false),array('modifier', 'default', '1.html', 29, false),array('modifier', 'escape', '1.html', 31, false),array('modifier', 'indent', '1.html', 33, false),array('modifier', 'regex_replace', '1.html', 35, false),array('modifier', 'strtoupper', '1.html', 35, false),array('modifier', 'strtolower', '1.html', 35, false),array('modifier', 'truncate_hd', '1.html', 39, false),)), $this); ?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
<!-- 变量 -->
<?php echo $this->_tpl_vars['name']; ?>
 <br>

<!-- 显示时间 格式化日期-->  
<?php echo ((is_array($_tmp=$this->_tpl_vars['time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%y-%m-%d %H-%M") : smarty_modifier_date_format($_tmp, "%y-%m-%d %H-%M")); ?>
  <br>

<!-- 单一数组 -->
<?php echo $this->_tpl_vars['username']['user']; ?>
 <br>

<!-- 多维数组 -->
<!-- $re = array('web'=>array('name'=>'后盾网','age'=>30));
$obj->assign('stu',$re); -->
<?php echo $this->_tpl_vars['stu']['web']['name']; ?>
&nbsp&nbsp<?php echo $this->_tpl_vars['stu']['web']['age']; ?>
 <br>

<!-- 直接输出 -->
<?php echo $this->_tpl_vars['html']; ?>
 <br>
<!-- 首字大写 -->
<?php echo ((is_array($_tmp=$this->_tpl_vars['html'])) ? $this->_run_mod_handler('capitalize', true, $_tmp) : smarty_modifier_capitalize($_tmp)); ?>
 <br>
<!-- 将cat里的值连接到给定的变量后面 -->
<?php echo ((is_array($_tmp=$this->_tpl_vars['username']['user'])) ? $this->_run_mod_handler('cat', true, $_tmp, 'baidu') : smarty_modifier_cat($_tmp, 'baidu')); ?>
 <br>
<!-- 变量没有时  设置一个默认值 -->
<?php echo ((is_array($_tmp=@$this->_tpl_vars['tjji'])) ? $this->_run_mod_handler('default', true, $_tmp, 'www.houdunwang.com') : smarty_modifier_default($_tmp, 'www.houdunwang.com')); ?>
 <br>
<!-- 用于html转码,url转码  把里面的内容全部格式输出-->
<?php echo ((is_array($_tmp=$this->_tpl_vars['html'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
 <br>
<!-- 在每行缩进字符串，默认是4个字符   需要带代码中看效果-->
<?php echo ((is_array($_tmp=$this->_tpl_vars['content'])) ? $this->_run_mod_handler('indent', true, $_tmp, 30) : smarty_modifier_indent($_tmp, 30)); ?>
 <br>
<!-- 正则替换   第一个参数/h2/ 为替换的规则   第二个参数为替换的内容-->
<?php echo ((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['content'])) ? $this->_run_mod_handler('regex_replace', true, $_tmp, '/h2/', 'h1') : smarty_modifier_regex_replace($_tmp, '/h2/', 'h1')))) ? $this->_run_mod_handler('strtoupper', true, $_tmp) : strtoupper($_tmp)))) ? $this->_run_mod_handler('strtolower', true, $_tmp) : strtolower($_tmp)); ?>


<!-- 字段截取 -->
<literal>
<?php echo ((is_array($_tmp=$this->_tpl_vars['sname'])) ? $this->_run_mod_handler('truncate_hd', true, $_tmp, 5) : truncate_hd($_tmp, 5)); ?>

</literal>

<!-- 循环函数 -->

<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	<?php echo $this->_tpl_vars['value']; ?>

<?php endforeach; endif; unset($_from); ?>
<hr>
<!-- 多维数组循环函数输出 -->
<?php $_from = $this->_tpl_vars['attr']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	
	姓名：<?php echo $this->_tpl_vars['value']['uname']; ?>


<?php endforeach; endif; unset($_from); ?>
<hr>
<!-- 多维数组的循环嵌套输出 -->
<?php $_from = $this->_tpl_vars['attr']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	<?php $_from = $this->_tpl_vars['value']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k2'] => $this->_tpl_vars['v']):
?>
		<?php echo $this->_tpl_vars['v']; ?>
 <br>
	<?php endforeach; endif; unset($_from); ?>
<?php endforeach; endif; unset($_from); ?>
<hr>
<!-- 复杂的循环输出  section -->
<?php unset($this->_sections['n']);
$this->_sections['n']['loop'] = is_array($_loop=$this->_tpl_vars['attr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['n']['name'] = 'n';
$this->_sections['n']['show'] = true;
$this->_sections['n']['max'] = $this->_sections['n']['loop'];
$this->_sections['n']['step'] = 1;
$this->_sections['n']['start'] = $this->_sections['n']['step'] > 0 ? 0 : $this->_sections['n']['loop']-1;
if ($this->_sections['n']['show']) {
    $this->_sections['n']['total'] = $this->_sections['n']['loop'];
    if ($this->_sections['n']['total'] == 0)
        $this->_sections['n']['show'] = false;
} else
    $this->_sections['n']['total'] = 0;
if ($this->_sections['n']['show']):

            for ($this->_sections['n']['index'] = $this->_sections['n']['start'], $this->_sections['n']['iteration'] = 1;
                 $this->_sections['n']['iteration'] <= $this->_sections['n']['total'];
                 $this->_sections['n']['index'] += $this->_sections['n']['step'], $this->_sections['n']['iteration']++):
$this->_sections['n']['rownum'] = $this->_sections['n']['iteration'];
$this->_sections['n']['index_prev'] = $this->_sections['n']['index'] - $this->_sections['n']['step'];
$this->_sections['n']['index_next'] = $this->_sections['n']['index'] + $this->_sections['n']['step'];
$this->_sections['n']['first']      = ($this->_sections['n']['iteration'] == 1);
$this->_sections['n']['last']       = ($this->_sections['n']['iteration'] == $this->_sections['n']['total']);
?>
	<!-- 获取序号 -->
	<?php echo $this->_sections['n']['first']; ?>
:
		
	<?php echo $this->_tpl_vars['attr'][$this->_sections['n']['index']]['uname']; ?>


	<!-- <?php echo $this->_sections['n']['index']; ?>
:
	<?php if ($this->_sections['n']['first']): ?>
		<b style='color:red' ><?php echo $this->_tpl_vars['attr'][$this->_sections['n']['index']]['uname']; ?>
 </b>	
	<?php else: ?>
		<?php echo $this->_tpl_vars['attr'][$this->_sections['n']['index']]['uname']; ?>

	<?php endif; ?> -->


<?php endfor; endif; ?>
</body>
</html>